$OpenBSD: patch-Makefile,v 1.1.1.1 2013/04/29 01:56:43 jsg Exp $
--- Makefile.orig	Tue Aug 28 15:30:07 2012
+++ Makefile	Fri Apr 12 16:38:03 2013
@@ -1,10 +1,10 @@
-CXXFLAGS= -O3 -fomit-frame-pointer
+CXXFLAGS?= -O3 -fomit-frame-pointer
 override CXXFLAGS+= -Wall -fsigned-char -fno-exceptions -fno-rtti
 
 PLATFORM= $(shell uname -s)
 PLATFORM_PREFIX= native
 
-INCLUDES= -Ishared -Iengine -Ifpsgame -Ienet/include
+INCLUDES= -Ishared -Iengine -Ifpsgame `pkg-config --cflags libenet`
 
 STRIP=
 ifeq (,$(findstring -g,$(CXXFLAGS)))
@@ -36,8 +36,8 @@ STD_LIBS= -static-libgcc -static-libstdc++
 endif
 CLIENT_LIBS= -mwindows $(STD_LIBS) -L$(WINBIN) -L$(WINLIB) -lSDL -lSDL_image -lSDL_mixer -lzlib1 -lopengl32 -lenet -lws2_32 -lwinmm
 else	
-CLIENT_INCLUDES= $(INCLUDES) -I/usr/X11R6/include `sdl-config --cflags`
-CLIENT_LIBS= -Lenet/.libs -lenet -L/usr/X11R6/lib -lX11 `sdl-config --libs` -lSDL_image -lSDL_mixer -lz -lGL
+CLIENT_INCLUDES= $(INCLUDES) `sdl-config --cflags`
+CLIENT_LIBS= `pkg-config --libs libenet` `sdl-config --libs` -lX11 -lSDL_image -lSDL_mixer -lz -lGL
 endif
 ifeq ($(PLATFORM),Linux)
 CLIENT_LIBS+= -lrt
@@ -106,7 +106,7 @@ SERVER_LIBS= -mwindows $(STD_LIBS) -L$(WINBIN) -L$(WIN
 MASTER_LIBS= $(STD_LIBS) -L$(WINBIN) -L$(WINLIB) -lzlib1 -lenet -lws2_32 -lwinmm
 else
 SERVER_INCLUDES= -DSTANDALONE $(INCLUDES)
-SERVER_LIBS= -Lenet/.libs -lenet -lz
+SERVER_LIBS= `pkg-config --libs libenet` -lz
 MASTER_LIBS= $(SERVER_LIBS)
 endif
 SERVER_OBJS= \
@@ -176,13 +176,13 @@ master: $(MASTER_OBJS)
 
 install: all
 else
-client:	libenet $(CLIENT_OBJS)
+client:	$(CLIENT_OBJS)
 	$(CXX) $(CXXFLAGS) -o sauer_client $(CLIENT_OBJS) $(CLIENT_LIBS)
 
-server:	libenet $(SERVER_OBJS)
+server:	$(SERVER_OBJS)
 	$(CXX) $(CXXFLAGS) -o sauer_server $(SERVER_OBJS) $(SERVER_LIBS)  
 	
-master: libenet $(MASTER_OBJS)
+master: $(MASTER_OBJS)
 	$(CXX) $(CXXFLAGS) -o sauer_master $(MASTER_OBJS) $(MASTER_LIBS)  
 
 shared/cube2font.o: shared/cube2font.c
